/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */
package cn.reg;

/**
 * <p>Project: jse2302 - RegExp7
 * <p>Powered by webrx On 2023-06-20 17:37:23
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class RegExp7 {
    public static void main(String[] args) {
        String a = "java8php123javascript6mysql88888html5";
        System.out.println(a);
        System.out.println(a.replaceAll("\\d", "-"));//没有贪婪，所以不存在禁用贪婪
        System.out.println(a.replaceAll("\\d{1,}", "-"));//有贪婪，所以可以禁用贪婪

        //
        System.out.println(a.replaceAll("\\d{1,}?", "-"));//有贪婪，所以可以禁用贪婪
        System.out.println(a.replaceAll("\\d+?", "-"));//有贪婪，所以可以禁用贪婪


    }
}
